<?php

use yii\db\Migration;

class m170509_065222_create_session extends Migration
{
    public function up()
    {
    /**
     *
    CREATE TABLE `session` (
    `id` char(255) NOT NULL,
    `expire` int(11) DEFAULT NULL,
    `data` longblob,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1
     */
    $sql = <<<EOD
CREATE TABLE `session` (
`id` char(255) NOT NULL,
`expire` int(11) DEFAULT NULL,
`data` LONGTEXT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
EOD;
    $this->db->createCommand($sql)->execute();
    

    }

    public function down()
    {
        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
